var EXPORTED_SYMBOLS = ["MLDonkeyUtils"];

var MLDonkeyUtils = new function() {
	var passwordManager = Components.classes["@mozilla.org/login-manager;1"].getService(Components.interfaces.nsILoginManager);
	
	var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
	
	var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
	
	var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo);

	var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"].getService(Components.interfaces.nsIVersionComparator);

	this.isFirefox4 = function() {
		return versionChecker.compare(appInfo.version, "4") >= 0;
	};
	
	this.isFirefox3 = function() {
		return versionChecker.compare(appInfo.version, "4") < 0;
	};

	this.getPasswordManager = function() {
		return passwordManager;
	};
	
	this.getPromptService = function() {
		return promptService;
	};
	
	this.getConsoleService = function() {
		return consoleService;
	};
};
